package com.ysstech.reportworld.service;

import com.ysstech.common.entity.PageBean;
import com.ysstech.common.entity.SheetDTO;
import com.ysstech.reportworld.entity.Table;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;


/**
 * <p>
 * 服务类
 * </p>
 *
 * @author lishuangliang
 * @since 2022-04-26
 */
public interface TableService extends IService<Table> {
    /**
     * 查询所有数据不分页
     *
     * @param table
     * @return
     * @throws Exception
     */
    public List<Table> queryAllReport(Table table) throws Exception;

    /**
     * 查询所有表信息
     *
     * @param table
     * @param pageBean
     * @return
     * @throws Exception
     */
    public PageBean<Table> queryAllReport(Table table, PageBean pageBean) throws Exception;

    /**
     * 新增表信息
     *
     * @param table
     * @throws Exception
     */
    public void addReportTable(Table table) throws Exception;

    /**
     * 删除表信息
     *
     * @param id
     * @throws Exception
     */
    public void deleteReportTable(String id) throws Exception;


    /**
     * 修改表信息 ,同步修改表字段得所属科目，模块，报表信息
     *
     * @param table
     * @throws Exception
     */
    public void updateReportTable(Table table) throws Exception;


    /**
     * 批量修改表信息
     *
     * @param table
     */
    public void batchUpdateTableInfo(Table table, String ids) throws Exception;

    /**
     * 获取一张表信息到库里
     *
     * @throws Exception
     */
    public void readTableInfo(String tableName) throws Exception;

    /**
     * 读取标准层文件，更新标准层表结构信息
     *
     * @throws Exception
     */
    public String getTableInfoExecl(MultipartFile multipartfile) throws Exception;

    /**
     * 导出execl
     */
    public List<SheetDTO> tableExeclList(String ids) throws Exception;

    /**
     * 导出建表语句
     */
    public String tableCreateJsonInfo(String ids, String ftype) throws Exception;

    /**
     * 查看表变更信息
     *
     * @param ids 选择的表以及客户
     * @return
     * @throws Exception
     */
    public Map<String, String> viewUpgradeTableInfo(String ids) throws Exception;

    /**
     * 和文件里的表对比差异
     *
     * @throws Exception
     */
    public String magerTableByFile(MultipartFile multipartfile) throws Exception;

    /**
     * 读取需求设计文档  同步字典字段和业务主键
     */
    public String readDemandDesign(MultipartFile multipartfile) throws Exception;
}
